package com.software.practicecenter.service;

import com.software.practicecenter.entity.MasterLevel;
import com.software.practicecenter.repository.MasterLevelRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collection;
import java.util.List;

/**
 * @Author xiaoliao
 * @Date 2023/5/31 14:38
 */
@Transactional
@Service
public class MasterLevelService {
    @Autowired
    private MasterLevelRepository masterLevelRepository;
    public List<MasterLevel> findByUserIdAndKnowledgeIdIn(String userId, Collection<String> ids) {
        return masterLevelRepository.findByUserIdAndKnowledgeIdIn(userId, ids);
    }

    public void saveAll(List<MasterLevel> masterLevelList) {
        masterLevelRepository.saveAll(masterLevelList);
    }
}
